package ru.cod.rs.x1000;

import java.io.PrintWriter;
import java.util.Scanner;

public class Z1409 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int a = in.nextInt();
		int b = in.nextInt();

		int t = a + b - 1;
		out.println((t - a) + " " + (t - b));
		out.flush();
	}
}
